package org.csmz.class2334;
public class example02 {
        public static void main(String[] args) {
            // 创建一个内容为空的字符串
            String s1 = new String();
            System.out.println("s1 = " + s1);

            // 创建一个内容为abc的字符串
            String s2 = new String("abc");
            System.out.println("s2 = " + s2);

            // 创建一个内容为字符数组的字符串
            char[] chars = {'h', 'e', 'l', 'l', 'o'};
            String s3 = new String(chars);
            System.out.println("s3 = " + s3);

            // 创建一个内容为字节数组的字符串
            byte[] bytes = {70, 98, 99};
            String s4 = new String(bytes);
            System.out.println("s4 = " + s4);
        }
    }

